﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Jzy;

namespace FortuneHeaven.Entity.GameScore
{
    public partial class GameScoreInfo : EntityBase
    {
        private const string TABLE_NAME = "GameScoreInfo";
        private const string INSERT_SQL = "insert into GameScoreInfo ( [UserID], [Score], [Revenue], [InsureScore], [WinCount], [LostCount], [DrawCount], [FleeCount], [UserRight], [MasterRight], [MasterOrder], [RegisterIP], [LastLogonIP], [RegisterDate], [LastLogonDate], [AllLogonTimes], [PlayTimeCount], [OnLineTimeCount], [Coupon]) values ( @UserID, @Score, @Revenue, @InsureScore, @WinCount, @LostCount, @DrawCount, @FleeCount, @UserRight, @MasterRight, @MasterOrder, @RegisterIP, @LastLogonIP, @RegisterDate, @LastLogonDate, @AllLogonTimes, @PlayTimeCount, @OnLineTimeCount, @Coupon)";
        private const string UPDATE_SQL = "update GameScoreInfo set  [UserID] = @UserID, [Score] = @Score, [Revenue] = @Revenue, [InsureScore] = @InsureScore, [WinCount] = @WinCount, [LostCount] = @LostCount, [DrawCount] = @DrawCount, [FleeCount] = @FleeCount, [UserRight] = @UserRight, [MasterRight] = @MasterRight, [MasterOrder] = @MasterOrder, [RegisterIP] = @RegisterIP, [LastLogonIP] = @LastLogonIP, [RegisterDate] = @RegisterDate, [LastLogonDate] = @LastLogonDate, [AllLogonTimes] = @AllLogonTimes, [PlayTimeCount] = @PlayTimeCount, [OnLineTimeCount] = @OnLineTimeCount, [Coupon] = @Coupon where ID = @ID";
        /// <summary>
        /// 用户 ID
        /// </summary>
        public Int32 UserID
        {
            get;
            set;
        }
        /// <summary>
        /// 用户积分（货币）
        /// </summary>
        public Int64 Score
        {
            get;
            set;
        }
        /// <summary>
        /// 游戏税收
        /// </summary>
        public Int64 Revenue
        {
            get;
            set;
        }
        /// <summary>
        /// 银行金币
        /// </summary>
        public Int64 InsureScore
        {
            get;
            set;
        }
        /// <summary>
        /// 胜局数目
        /// </summary>
        public Int32 WinCount
        {
            get;
            set;
        }
        /// <summary>
        /// 输局数目
        /// </summary>
        public Int32 LostCount
        {
            get;
            set;
        }
        /// <summary>
        /// 和局数目
        /// </summary>
        public Int32 DrawCount
        {
            get;
            set;
        }
        /// <summary>
        /// 逃局数目
        /// </summary>
        public Int32 FleeCount
        {
            get;
            set;
        }
        /// <summary>
        /// 用户权限
        /// </summary>
        public Int32 UserRight
        {
            get;
            set;
        }
        /// <summary>
        /// 管理权限
        /// </summary>
        public Int32 MasterRight
        {
            get;
            set;
        }
        /// <summary>
        /// 管理等级
        /// </summary>
        public Byte MasterOrder
        {
            get;
            set;
        }
        /// <summary>
        /// 注册 IP
        /// </summary>
        public String RegisterIP
        {
            get;
            set;
        }
        /// <summary>
        /// 上次登陆 IP
        /// </summary>
        public String LastLogonIP
        {
            get;
            set;
        }
        /// <summary>
        /// 注册时间
        /// </summary>
        public DateTime RegisterDate
        {
            get;
            set;
        }
        /// <summary>
        /// 上次登陆时间
        /// </summary>
        public DateTime LastLogonDate
        {
            get;
            set;
        }
        /// <summary>
        /// 总登陆次数
        /// </summary>
        public Int32 AllLogonTimes
        {
            get;
            set;
        }
        /// <summary>
        /// 游戏时间
        /// </summary>
        public Int32 PlayTimeCount
        {
            get;
            set;
        }
        /// <summary>
        /// 在线时间
        /// </summary>
        public Int32 OnLineTimeCount
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32? Coupon
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "userid":
                    this.UserID = (Int32)value;
                    break;
                case "score":
                    this.Score = (Int64)value;
                    break;
                case "revenue":
                    this.Revenue = (Int64)value;
                    break;
                case "insurescore":
                    this.InsureScore = (Int64)value;
                    break;
                case "wincount":
                    this.WinCount = (Int32)value;
                    break;
                case "lostcount":
                    this.LostCount = (Int32)value;
                    break;
                case "drawcount":
                    this.DrawCount = (Int32)value;
                    break;
                case "fleecount":
                    this.FleeCount = (Int32)value;
                    break;
                case "userright":
                    this.UserRight = (Int32)value;
                    break;
                case "masterright":
                    this.MasterRight = (Int32)value;
                    break;
                case "masterorder":
                    this.MasterOrder = (Byte)value;
                    break;
                case "registerip":
                    this.RegisterIP = (String)value;
                    break;
                case "lastlogonip":
                    this.LastLogonIP = (String)value;
                    break;
                case "registerdate":
                    this.RegisterDate = (DateTime)value;
                    break;
                case "lastlogondate":
                    this.LastLogonDate = (DateTime)value;
                    break;
                case "alllogontimes":
                    this.AllLogonTimes = (Int32)value;
                    break;
                case "playtimecount":
                    this.PlayTimeCount = (Int32)value;
                    break;
                case "onlinetimecount":
                    this.OnLineTimeCount = (Int32)value;
                    break;
                case "coupon":
                    this.Coupon = (Int32?)value;
                    break;
            }
        }
    }

}
